<?php
/**
 * 初始化
 * $Id$
 */

if (!defined('IN_APP')) {
	die('Hacking attempt!');
}

/* 定义根目录*/
if (!defined('ROOT_PATH')) {
	define('ROOT_PATH', dirname(dirname(dirname(__FILE__))));
}

/* 清除所有和文件操作状态香光信息*/
clearstatcache();

if (isset($_SERVER['PHP_SELF'])) {
	define('PHP_SELF', $_SERVER['PHP_SELF']);
} else {
	define('PHP_SELF', $_SERVER['SCRIPT_NAME']);
}

require_once ROOT_PATH . '/includes/function.base.php';
require_once ROOT_PATH . '/includes/function.time.php';
require_once ROOT_PATH . '/includes/Smarty/Smarty.class.php';

/* 初始化模版类*/
$smarty = new Smarty();
$smarty->template_dir = ROOT_PATH . '/install/themes/templates';
$smarty->cache_dir = ROOT_PATH . '/install/themes/caches';
$smarty->compile_dir = ROOT_PATH . '/install/themes/compiled';

require_once ROOT_PATH . '/includes/cls_error.php';
$err = new error('message.tpl');

require_once ROOT_PATH . '/install/includes/lib_installer.php';

/* 发送头部 保证浏览器识别UTF8编码*/
header('Content-type: text/html; charset=utf-8');
